package org.xiaojinlong.exam;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Jin Long
 * 2015/9/12
 */
public class Wild {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n, t, c;
        int ways;
        while (scanner.hasNext()) {
            ways = 0;
            n = scanner.nextInt();
            t = scanner.nextInt();
            c = scanner.nextInt();
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = scanner.nextLong();

            for (int i = 0; i <= n - c; i++) {
                int sum = 0;
                for (int j = i, len = i + c; j < len; j++)
                    sum += a[j];
                if (sum <= t) ways++;
            }
            System.out.println(ways);
        }
    }
}
